package area;

import studentsAndDocentWithTutorship.Docent;
import university.University;

/**
 * @author Maria Laura Medici
 */
public class Pass {
	/* ******************************** Variables ******************************** */
	private Area sourceArea;
	private Area detination;
	private PassState result;
	private String description;
	private Docent docente;
	private String advice;
	
	/* ******************************* Constructor ******************************* */
	public Pass(Area areaOrigen,Area areaDestino, Docent docente, String descripcion ){
		this.sourceArea=areaOrigen;
		this.detination= areaDestino;
		this.result= new InDemand();
		this.description = descripcion;
		this.docente= docente;
	}
	
	/* ******************************** Get & Set ******************************** */
	public Area getSourceArea() {
		return sourceArea;
	}

	public void setSourceArea(Area sourceArea) {
		this.sourceArea = sourceArea;
	}

	public Area getDetination() {
		return detination;
	}

	public void setDetination(Area detination) {
		this.detination = detination;
	}

	public PassState getResult() {
		return result;
	}

	public void setResult(PassState result) {
		this.result = result;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	
	public void setAdvice(String advice) {
		this.advice = advice;
	}
	
	public Docent getDocente() {
		return docente;
	}

	public void setDocente(Docent docente) {
		this.docente = docente;
	}

	public String getAdvice() {
		return advice;
	}
	
	/* ********************************* Metodos ********************************* */
	
	/**
	 * Permite ver el estado del pase
	 */
	public void verEstado(){
		System.out.print(this.getResult().getName());
	}
	
	
	/**
	 * Se aconseja el pase por la Universidad
	 * @throws Exception 
	 */
	public void advise(String consejo) throws Exception{
			this.getResult().adviseState(this, consejo);
		
	}
	
	/**
	 * Acepta el pase, lo al macena y hace el cambio 
	 * @param universidad
	 * @throws Exception
	 */
	public void aceptar(University universidad) throws Exception{
		this.getResult().aceptar( universidad, this);
		
		
	}

	/**
	 * Rechaza el pase y lo almacena 
	 * @param universidad
	 * @throws Exception
	 */
	public void rechazar(University universidad) throws Exception{
		this.getResult().rechazar(universidad, this);
		
	}
	
	
}

